package com.neusoft.ysu.his.mapper;


import com.neusoft.ysu.his.entity.Patient;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 作者：赵子鉴
 * @since 2023-08-25
 */
@Mapper
public interface PatientMapper extends BaseMapper<Patient> {

    @Select("SELECT count(*) FROM patient WHERE weekday=#{weekday} AND noon=#{noon} AND doc_id=#{id} AND (delmark>0 AND delmark<3)")
    String calculateNum(int weekday, String noon, int id);
    @Select("select * from patient ")
    List<Patient> MyselectAll();

    @Select("UPDATE patient SET delmark=#{delmark} WHERE id=#{id}")
    Integer reDelById(int delmark,int id);
    @Select("select * from patient where delmark=3 OR delmark=4 OR delmark=5")
    List<Patient> findPaid();
}
